<template>
  <div>
    <el-dialog title="生产领料单详情"  width="1100px" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>
      <el-form ref="form" :model=" prdPickform " size="small" label-width="80px" :inline="true" class="header">
        <el-row>
          <el-col :span="8">
            <el-form-item label="生产领料单据编号:" class="no-wrap-label">{{ prdPickform.fbillno }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="金蝶单据编号:" class="no-wrap-label" label-width="130px">{{ prdPickform.fkdbillno }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单据日期:" class="no-wrap-label">{{ prdPickform.fdate }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="生产订单单据编号:" class="no-wrap-label" label-width="130px">{{ prdPickform.fbillnomo }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="创建人:" class="no-wrap-label">{{ prdPickform.fcreateuser }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联副产品物料名称:" class="no-wrap-label" label-width="130px">{{ prdPickform.joinMaterialName }}</el-form-item>
          </el-col>
          <el-col :span="8">
          <el-form-item label="联副产品单位名称:" class="no-wrap-label" label-width="130px">{{ prdPickform.joinMaterialNo }}</el-form-item>
        </el-col>
          <el-col :span="8">
            <el-form-item label="单据状态:" class="no-wrap-label">
              {{ prdPickform.fstate == 1 ? '作废' : '审核' }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车间名称:" class="no-wrap-label">{{ prdPickform.fworkshopname }}</el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="创建日期:" class="no-wrap-label">{{ prdPickform.createTime }}</el-form-item>
          </el-col>
        </el-row>

        <br />
      </el-form>

      <el-table :data="prdPickdetailList" height="calc(100vh - 300px)">
        <!--        <el-table-column label="No." width="60" align="right" type="index"></el-table-column>-->
        <el-table-column label="生产领料单据编号" width="130" prop="fbillno"></el-table-column>
        <el-table-column label="物料编码" width="120" prop="fmaterialnumber"></el-table-column>
        <el-table-column label="物料名称" width="120" prop="fmaterialname"></el-table-column>
        <el-table-column label="规格型号" width="120" prop="fspecification"></el-table-column>
        <el-table-column label="单位名称" width="120" prop="funitname"></el-table-column>
        <el-table-column label="单位编码" width="120" prop="funitid"></el-table-column>

        <el-table-column label="实发数量" width="120" prop="finfactqty"></el-table-column>
        <el-table-column label="仓库名称" width="120" prop="fstocknumber"></el-table-column>
        <el-table-column label="仓位名称" width="120" prop="flocationnumber"></el-table-column>
        <el-table-column label="批号" width="120" prop="flot"></el-table-column>

        <el-table-column label="是否临时数据" width="120" prop="fistest" :formatter="formatBoolean"></el-table-column>



      </el-table>


    </el-dialog>

  </div>
</template>
<script>
import { detail  } from '@/api/app/prdpick'
export default {
	name:'prdPickdetail',
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
      prdPickform:{},
      prdPickdetailList:[]
		}
	},
	watch:{
		show(val){
			if(val){
			}
		}
	},
	methods: {
    formatBoolean(row, column, cellValue) {
      return cellValue === 1 ? '是' : cellValue === 0 ? '否' : '-'
    },
    open(){
      detail(this.info).then(res => {
        if (res.status == 200) {
          this.prdPickform = res.data.data;
          this.prdPickdetailList = res.data.dataList;
          console.log('receList',this.receList)
        } else {
          this.$message.error('获取详情失败2，请稍后再试');
        }
      }).catch(error => {
        this.$message.error('获取详情失败，请稍后再试');
      });
		},
		closeForm(){
			this.$emit('update:show', false)
		}
	}
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss';
</style>
